/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package StartUp;

import java.awt.event.ActionEvent;
import javax.swing.AbstractAction;
import javax.swing.JMenu;
import javax.swing.JMenuItem;
import bluej.extensions.BClass;
import bluej.extensions.BPackage;
import bluej.extensions.BProject;
import bluej.extensions.MenuGenerator;
import bluej.extensions.PackageNotFoundException;
import bluej.extensions.ProjectNotOpenException;
import javax.swing.JOptionPane;

public class MenuBuilder extends MenuGenerator {

    private BPackage curBpkg;
    private BClass curBclass;
    private BProject curBproj;

    @Override
    public JMenuItem getToolsMenuItem(BPackage bpkg) {
        return new JMenuItem(new SimpleAction("CommDrawer", "Menu Classe"));
    }

    @Override
    public JMenuItem getClassMenuItem(BClass bclass) {
        JMenu jm = new JMenu("CommDraw");
        jm.add(new JMenuItem(new SimpleAction("Class Info", "Menu Classe")));

        return jm;
    }

    @Override
    public void notifyPostClassMenu(BClass bc, JMenuItem jmi) {

        curBpkg = null;
        curBclass = bc;
    }

    class SimpleAction extends AbstractAction {

        /**
         * 
         */
        private static final long serialVersionUID = 1L;

        public SimpleAction(String menuName, String msg) {
            putValue(AbstractAction.NAME, menuName);

        }

        @Override
        public void actionPerformed(ActionEvent e) {
            JOptionPane.showMessageDialog(null, "Abriu app.");
            new DcoBlueJStartUp().start();
        }
    }
}
